//
//  NoNetWorkView.m
//  HeWeiZhiNeng
//
//  Created by 林建 on 17/12/4.
//  Copyright © 2017年 YanCeyMichael.github.io. All rights reserved.
//

#import "NoNetWorkView.h"

@implementation NoNetWorkView

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        //图片
        self.errorView = [[UIImageView alloc]initWithFrame:CGRectMake(90-25/2, 10, 25, 25)];
        [self addSubview:self.errorView];
        self.errorView.image = [UIImage imageNamed:@"NetworkError"];
        //标题
        self.expalinL = [[UILabel alloc]initWithFrame:CGRectMake(90-50, 35, 100, 40)];
        [self addSubview:self.expalinL];
        NSMutableAttributedString *str1 = [[NSMutableAttributedString alloc]initWithString:@"网络连接失败请检查网络"];
        //行间距
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        [paragraphStyle setLineSpacing:6];
        [str1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, 6)];
        //字体
        [str1 addAttribute:NSFontAttributeName value:Common_Font(15) range:NSMakeRange(0, 6)];
        [str1 addAttribute:NSFontAttributeName value:Common_Font(12) range:NSMakeRange(6, 4)];
        self.expalinL.attributedText = str1;
        self.expalinL.textAlignment = NSTextAlignmentCenter;
        self.expalinL.textColor = [UIColor whiteColor];
        self.expalinL.numberOfLines = 0;
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
